<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>城市选择demo</title>
    <script type="text/javascript"
            src="https://api.map.baidu.com/api?v=2.0&ak=QDUfMKo8APcODw5KAnnNMryb9P4rnwLh"></script>
    <!-- <script src="./src/common/vhomed.js"></script> -->
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<script>
     //- 设置根元素fontSize~
    (function (doc, win) {
        var _root = doc.documentElement,
            _width=document.body.clientWidth || document.documentElement.clientWidth,
            resizeEvent = 'orientationchange' in window ? 'orientationchange' : 'resize';
        function resizeFont () {
        var clientWidth = _root.clientWidth;
        // 设计师给的设计稿的宽度：640px
        // _root.style.fontSize = (clientWidth/6.4) + 'px';
        document.getElementsByTagName("html")[0].style.fontSize = _width / 6.4 + "px";
        //console.log('w:' + clientWidth );
        }
        win.addEventListener(resizeEvent, resizeFont, false);
        doc.addEventListener('DOMContentLoaded', resizeFont, false);
    })(document, window);
</script>
</html>
